﻿using System;
using System.Collections.Generic;
using System.Xml;
using System.Linq;
using System.Text;

namespace Admx_Generator
{
    public class CheckBoxPresentation : IPresentationElement
    {
        public CheckBoxPresentation(string refId, string value)
        {
            this.RefId = refId;
            this.Value = value;
            this.DefaultChecked = false;
        }

        private string RefId { get; set; }
        private string Value { get; set; }
        public bool DefaultChecked { get; set; }

        public void Save(XmlWriter xmlWriter)
        {
            // checkBoxPresentation
            xmlWriter.WriteStartElement("checkBox");
            xmlWriter.WriteAttributeString("refId", this.RefId);
            xmlWriter.WriteAttributeString("defaultChecked", this.DefaultChecked.ToString().ToLower());
            xmlWriter.WriteValue(this.Value);
            xmlWriter.WriteEndElement(); // checkBoxPresentation
        }
    }
}
